wowwikifandomcom-20200223-history
Useful macros
=Spells= Self Cast any spell /target "player" /cast SpellName(Rank x) /script TargetLastEnemy(); Change SpellName(Rank x) by the Spell name and his rank. Example /target "player" /cast Purify(Rank 1) /script TargetLastEnemy(); A better version, which does not lose original target: /cast Holy Light(Rank 3) /script TargetByName("player"); just a quick spell for duelling hunters if u are shaman: /target "player" /cast cure poison hunters have a mana sting which reduces your mana...i always have this clickable when duelling a hunter...confounds them :) Selfcasting non-enemy spells Some spells can not be cast on enemies. Thus, if you have an enemy targeted, you can cast them on yourself. Example This macro will only cast the spell if it can be cast on you: /script if ( not UnitIsFriend("player", "target") ) then CastSpellByName("Spell(Rank 1)"); end /script if ( SpellIsTargeting() ) then SpellTargetUnit("player"); end Replace Spell(Rank 1) with the name and rank of the ability you wish to use. Cast a spell based on target's class You'll need to target the person you want to buff first. Here's an example for a paladin to use; note that it should all be on one line: /script class = UnitClass("target"); if ( ( class "Rogue" ) or ( class "Warrior" ) ) then CastSpellByName("Blessing of Might(Rank 1)"); else CastSpellByName("Blessing of Wisdom(Rank 1)"); end Cast a spell based on target's level You'll need to target the person you want to buff first. Here's an example for a mage to use on an English language server. You have to alter the spell name according to the spell you want to cast; note that it should all be on one line: /script pr="Arcane Intellect(Rank " sp={1,10,18,33,46} if (UnitLevel("target") ~= nil and UnitIsFriend("player","target"))then for i=5,1,-1 do if (UnitLevel("target") >= spi) then CastSpellByName(pr..(i)..")") break end end end Announcing spells and targets to your party Good for healing and crowd control spells. Example with a healing spell (Party member must be targeted first to make the party announcement work): /cast Healing Touch(Rank 9) /party Healing %t in 3.5 seconds Announcing spells and cast on friendly target only This alternative checks to be sure that the current target is a player character. (No more Healing "insert mob here" in 3.5 seconds) Tends to get group members upset if it apears you are trying to heal the mobs. It also sends a whisper to the player you are healing instead of having heal spams for everyone in party chat. (NOTE: Do not include the returns. Doesnt cast on pets.) /script nm = UnitName("target"); pl = UnitIsPlayer("target") if ((nm ~= nil) and (pl 1))then SendChatMessage("Healing you for (143 - 165) in 2.5 sec" , "WHISPER", "COMMON", UnitName("target") ); CastSpellByName("lesser heal(Rank 3)"); end = Inventory/Items = Equip an item /script PickupContainerItem(bag, slot); bag goes from 0 to 4, and slot from 1 to 20 (depending on bag size). For more information, go to Item equipping to see how to use items from backpacks, etc., and information on how to prevent accidental vendoring of items due to macros. Use a Bandage /script UseAction(ActionID, 0, 1); /script if( SpellIsTargeting() ) then SpellTargetUnit("player"); end Bandage must be placed in the action bar at the slot given by ActionID. ActionID is a number from 1 to 120. Slot1-ActionBar1 is ActionID1, Slot12 is ActionID12, Slot1-ActionBar2 is ActionID13 and so on up to Slot12 of ActionBar10. This will bandage your target, or yourself if your current target is not a friendly target. Here's a different version courtesy of post by Sarf on the forums. This one will always self-bandage, even if you have a friendly player targeted. It will also re-target your original target. Note that this must all be on one line, its just split up for readability: /script p="player";t="target";if(not UnitCanAttack(t, p))then ot=UnitName(t);TargetUnit(p); else ot=nil;end;UseAction(ActionID);if(SpellIsTargeting())then SpellTargetUnit(p); end if(ot) then TargetByName(ot);end Following is another example of self bandaging that does not use scripting. Shift-clicking on the bandage (or other item in inventory) while editing your macro will insert its name into your macro. Placing the "target" command after the "use" command maintains your primary target and also maintains your combo points for that target if you're a Rogue. /use Heavy Linen Bandage /target player Note: As of WoW UI version 1300, when you use the /target command use player not "player" to target yourself. Script command /target does NOT require Cosmos mod, but the /use command does. You may experience problems with the script above, because it uses not standard commands. If you place your Heavy bandage in the second ActionBar slot 5 you can use this small macro to use the bandage on your self. This works even, with no Cosmos or something else installed. /script TargetUnit("player"); /script UseAction(17); You have to use 17, because it is 2nd Actionbar and 5th slot ((2-1)*12+5=17). Reference ActionID's: Actionbar Slot number 1: 1 2 3 4 5 6 7 8 9 10 11 12 2: 13 14 15 16 17 18 19 20 21 22 23 24 3: 25 26 27 28 29 30 31 32 33 34 35 36 4: 37 38 39 40 41 42 43 44 45 46 47 48 5: 49 50 51 52 53 54 55 56 57 58 59 60 6: 61 62 63 64 65 66 67 68 69 70 71 72 = Interface = Switching Hotbars /script CURRENT_ACTIONBAR_PAGE = X; /script ChangeActionBarPage(); Where X is the Hotbar number Example /script CURRENT_ACTIONBAR_PAGE = 1; /script ChangeActionBarPage(); Macro Frame Toggling /script if ( not MacroFrame:IsVisible() ) then ShowUIPanel(MacroFrame); else HideUIPanel(MacroFrame); end; = Group Combat = Help Tank Character If you are in a group and fighting a larger Group of enemies, and your group tank character is already fighting an enemy, you may not want to attack one which did not have Aggro yet. Select your group tank via key F and execute follow macro. /assist %t /script AttackTarget(); = Miscellaneous = Adjusting Quest Fade To change it to a more reasonable speed, try: /script QUEST_DESCRIPTION_GRADIENT_CPS = 100; To disable it altogether, use /script QUEST_FADING_ENABLE = nil; Both of these need to be pasted or typed into the chat box. To simplify use, they could also be made into a macro button. To save them permanently, type /script RegisterForSave(QUEST_DESCRIPTION_GRADIENT_CPS) and similarly for QUEST_FADING_ENABLE if you use that instead. Pet Attack /script PetAttack(); A useful extension of this is to have your pet begin assisting your main tank with one button. /target player /assist /script PetAttack(); Optionally, you could add a fourth line that casts one of your spells so that you begin fighting too. Local Server time /script hour,min=GetGameTime() /script DEFAULT_CHAT_FRAME:AddMessage(format("Server time is %s:%s",hour,min)); Location /script px,py=GetPlayerMapPosition("player") /script DEFAULT_CHAT_FRAME:AddMessage(format("[ %s ] %s , %s",GetZoneText(),px,py)); ''Value will be between 0,0 (Bottom Left corner of current map) and 1,1 (Top right) Instance resetting /invite PlayerInAGroup /script leaveParty() What this does is resetting instances, and is very useful for mages that grinds DM East for example. Change PlayerInAGroup to the nick of a player who is in a group, and make this macro. When you press it, the instance is reset. 'This macro no longer works.''' ---- Go to Macros Go to Interface Customization